<commit_before>/**
 * grunt-responsive-images
 * https://github.com/andismith/grunt-responsive-images
 *
 * Copyright (c) 2013 andismith
 * Licensed under the MIT license.
 *
 * Test suite for Grunt Responsive Images
 *
 * @author Andi Smith (http://twitter.com/andismith)
 * @version 1.0
 */

/*
  ======== A Handy Little Nodeunit Reference ========
  https://github.com/caolan/nodeunit

  Test methods:
    test.expect(numAssertions)
    test.done()
  Test assertions:
    test.ok(value, [message])
    test.equal(actual, expected, [message])
    test.notEqual(actual, expected, [message])
    test.deepEqual(actual, expected, [message])
    test.notDeepEqual(actual, expected, [message])
    test.strictEqual(actual, expected, [message])
    test.notStrictEqual(actual, expected, [message])
    test.throws(block, [error], [message])
    test.doesNotThrow(block, [error], [message])
    test.ifError(value)
*/

(function() {
  'use strict';

  var async = require('async'),
    grunt = require('grunt'),
    im = require('node-imagemagick'),
    q = require('q');

  /**
   * Compare the created image against the expected image.
   *
   * @private
   * @param   {string}  filename  The name of the file
   * @param   {string}  actual    The actual file path
   * @param   {string}  expected  The expected file path
   * @return  {object}  promise   Either resolved rejected with an error message.
   */
  var compareImageProperties = function(filename, actualPath, expectedPath) {
    var deferred = q.defer();

    // load created image
    im.identify(actualPath + filename, function(error, actualProp) {
      if (error) {
        deferred.reject('Failed to load actual (created) image "' + actualPath + filename + '"');
      } else {
        // load expected image
        im.identify(expectedPath + filename, function(error, expectedProp) {
          if (error) {
            deferred.reject('Failed to load expected image "' + expectedPath + filename + '"');
          } else {
            // check if we have a match
            if ((actualProp.compression === expectedProp.compression) &&
              (actualProp.width === expectedProp.width) &&
              (actualProp.height === expectedProp.height) &&
              (actualProp.quality === expectedProp.quality) &&
              (actualProp.filesize === expectedProp.filesize)) {
              deferred.resolve(true);
            } else {
              deferred.reject(filename + ': ' +
                'actual image (' + actualProp.compression + ' ' + actualProp.width + 'x' + actualProp.height +
                ' - Q:' + actualProp.quality + ' - ' + actualProp.filesize +
                ') and ' +
                'expected image (' + expectedProp.compression + ' ' + expectedProp.width + 'x' + expectedProp.height +
                ' - Q:' + expectedProp.quality + ' - ' + expectedProp.filesize +
                ') should match');
            }
          }
        });
      }
    });
    return deferred.promise;
  };

  /**
   * Inspect and handle test results from inspecting an image
   *
   * @private
   * @param   {object}  file      The file object
   * @param   {object}  test      Test instance
   * @param   {string}  callback  Async callback, to be run when the test is complete
   */
  var inspectImage = function(file, test, callback) {
    compareImageProperties(file.filename, file.actual, file.expected)
    .then(function(result) {
      test.ok(true);
    }, function(error) {
      test.ok(false, error);
    })
    .done(function() {
      return callback();
    });
  };

  /**
   * Run through the array of files and add them to the queue of images to be tested
   *
   * @private
   * @param   {array}   files     List of files to check (with filename, expected and actual paths)
   * @param   {object}  test      Test instance
   */
  var checkImages = function(actual, expected, files, test) {
    var series = [],
        file = {};

    test.expect(files.length);

    files.forEach(function(filename) {
      var file = {
        actual: actual,
        expected: expected,
        filename: filename
      };

      series.push(function(callback) {
        inspectImage(file, test, callback);
      });
    });

    async.series(series, function() {
      test.done();
    });
  };

  // List of tests to be run
  exports.responsive_images = {
    default_options: function(test) {
      var actualPath = 'tmp/default_options/',
          expectedPath = 'test/expected/default_options/',
          files = [
            'minions-small.jpg',
            'minions-medium.jpg',
            'minions-large.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    file_wildcard_options: function(test) {
      var actualPath = 'tmp/file_wildcard_options/',
          expectedPath = 'test/expected/file_wildcard_options/',
          files = [
            'sonic-small.png',
            'sonic-medium.png',
            'sonic-large.png',
            'mario-yoshi-small.jpg',
            'mario-yoshi-medium.jpg',
            'mario-yoshi-large.jpg',
            'mickey-mouse-small.gif',
            'mickey-mouse-medium.gif',
            'mickey-mouse-large.gif'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    custom_options: function(test) {
      var actualPath = 'tmp/custom_options/',
          expectedPath = 'test/expected/custom_options/',
          files = [
            'panther-small.jpg',
            'panther-220.jpg',
            'panther-large.jpg',
            'panther-large_x2.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    percentage_sizes: function(test) {
      var actualPath = 'tmp/percentage_sizes/',
          expectedPath = 'test/expected/percentage_sizes/',
          files = [
            'captain-planet-10%.jpg',
            'captain-planet-50%.jpg',
            'captain-planet-200%.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    custom_dest_width: function(test) {
      var actualPath = 'tmp/custom_dest_width/',
          expectedPath = 'test/expected/custom_dest_width/',
          files = [
            '320/cedric_sneer.jpg',
            '640/cedric_sneer.jpg',
            '1024/cedric_sneer.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    custom_dest_name: function(test) {
      var actualPath = 'tmp/custom_dest_name/',
          expectedPath = 'test/expected/custom_dest_name/',
          files = [
            'leo/tmnt.png',
            'donnie/tmnt.png',
            'raph/tmnt.png'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    custom_dest_path: function (test) {
      var actualPath = 'tmp/custom_dest_path/',
          expectedPath = 'test/expected/custom_dest_path/',
          files = [
            '320/battle-cat.jpg',
            '640/sub_directory/battle-dog.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    }
  };
}());
<commit_msg>Fix to get Travis-CI passing (hopefully)<commit_after>/**
 * grunt-responsive-images
 * https://github.com/andismith/grunt-responsive-images
 *
 * Copyright (c) 2013 andismith
 * Licensed under the MIT license.
 *
 * Test suite for Grunt Responsive Images
 *
 * @author Andi Smith (http://twitter.com/andismith)
 * @version 1.0
 */

/*
  ======== A Handy Little Nodeunit Reference ========
  https://github.com/caolan/nodeunit

  Test methods:
    test.expect(numAssertions)
    test.done()
  Test assertions:
    test.ok(value, [message])
    test.equal(actual, expected, [message])
    test.notEqual(actual, expected, [message])
    test.deepEqual(actual, expected, [message])
    test.notDeepEqual(actual, expected, [message])
    test.strictEqual(actual, expected, [message])
    test.notStrictEqual(actual, expected, [message])
    test.throws(block, [error], [message])
    test.doesNotThrow(block, [error], [message])
    test.ifError(value)
*/

(function() {
  'use strict';

  var async = require('async'),
    grunt = require('grunt'),
    im = require('node-imagemagick'),
    q = require('q');

  /**
   * Compare the created image against the expected image.
   *
   * @private
   * @param   {string}  filename  The name of the file
   * @param   {string}  actual    The actual file path
   * @param   {string}  expected  The expected file path
   * @return  {object}  promise   Either resolved rejected with an error message.
   */
  var compareImageProperties = function(filename, actualPath, expectedPath) {
    var deferred = q.defer();

    // load created image
    im.identify(actualPath + filename, function(error, actualProp) {
      if (error) {
        deferred.reject('Failed to load actual (created) image "' + actualPath + filename + '"');
      } else {
        // load expected image
        im.identify(expectedPath + filename, function(error, expectedProp) {
          if (error) {
            deferred.reject('Failed to load expected image "' + expectedPath + filename + '"');
          } else {
            // check if we have a match
            if ((actualProp.compression === expectedProp.compression) &&
              (actualProp.width === expectedProp.width) &&
              (actualProp.height === expectedProp.height) &&
              (actualProp.quality === expectedProp.quality)) {
              deferred.resolve(true);
            } else {
              deferred.reject(filename + ': ' +
                'actual image (' + actualProp.compression + ' ' + actualProp.width +
                'x' + actualProp.height + ' - Q:' + actualProp.quality
                ') and ' +
                'expected image (' + expectedProp.compression + ' ' + expectedProp.width +
                'x' + expectedProp.height + ' - Q:' + expectedProp.quality
                ') should match');
            }
          }
        });
      }
    });
    return deferred.promise;
  };

  /**
   * Inspect and handle test results from inspecting an image
   *
   * @private
   * @param   {object}  file      The file object
   * @param   {object}  test      Test instance
   * @param   {string}  callback  Async callback, to be run when the test is complete
   */
  var inspectImage = function(file, test, callback) {
    compareImageProperties(file.filename, file.actual, file.expected)
    .then(function(result) {
      test.ok(true);
    }, function(error) {
      test.ok(false, error);
    })
    .done(function() {
      return callback();
    });
  };

  /**
   * Run through the array of files and add them to the queue of images to be tested
   *
   * @private
   * @param   {array}   files     List of files to check (with filename, expected and actual paths)
   * @param   {object}  test      Test instance
   */
  var checkImages = function(actual, expected, files, test) {
    var series = [],
        file = {};

    test.expect(files.length);

    files.forEach(function(filename) {
      var file = {
        actual: actual,
        expected: expected,
        filename: filename
      };

      series.push(function(callback) {
        inspectImage(file, test, callback);
      });
    });

    async.series(series, function() {
      test.done();
    });
  };

  // List of tests to be run
  exports.responsive_images = {
    default_options: function(test) {
      var actualPath = 'tmp/default_options/',
          expectedPath = 'test/expected/default_options/',
          files = [
            'minions-small.jpg',
            'minions-medium.jpg',
            'minions-large.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    file_wildcard_options: function(test) {
      var actualPath = 'tmp/file_wildcard_options/',
          expectedPath = 'test/expected/file_wildcard_options/',
          files = [
            'sonic-small.png',
            'sonic-medium.png',
            'sonic-large.png',
            'mario-yoshi-small.jpg',
            'mario-yoshi-medium.jpg',
            'mario-yoshi-large.jpg',
            'mickey-mouse-small.gif',
            'mickey-mouse-medium.gif',
            'mickey-mouse-large.gif'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    custom_options: function(test) {
      var actualPath = 'tmp/custom_options/',
          expectedPath = 'test/expected/custom_options/',
          files = [
            'panther-small.jpg',
            'panther-220.jpg',
            'panther-large.jpg',
            'panther-large_x2.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    percentage_sizes: function(test) {
      var actualPath = 'tmp/percentage_sizes/',
          expectedPath = 'test/expected/percentage_sizes/',
          files = [
            'captain-planet-10%.jpg',
            'captain-planet-50%.jpg',
            'captain-planet-200%.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    custom_dest_width: function(test) {
      var actualPath = 'tmp/custom_dest_width/',
          expectedPath = 'test/expected/custom_dest_width/',
          files = [
            '320/cedric_sneer.jpg',
            '640/cedric_sneer.jpg',
            '1024/cedric_sneer.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    custom_dest_name: function(test) {
      var actualPath = 'tmp/custom_dest_name/',
          expectedPath = 'test/expected/custom_dest_name/',
          files = [
            'leo/tmnt.png',
            'donnie/tmnt.png',
            'raph/tmnt.png'
          ];

      checkImages(actualPath, expectedPath, files, test);
    },
    custom_dest_path: function (test) {
      var actualPath = 'tmp/custom_dest_path/',
          expectedPath = 'test/expected/custom_dest_path/',
          files = [
            '320/battle-cat.jpg',
            '640/sub_directory/battle-dog.jpg'
          ];

      checkImages(actualPath, expectedPath, files, test);
    }
  };
}());
<|endoftext|>


<commit_before>'use strict';
describe('Directive: Poster', function () {
  var element;
  var $sce;
	var $scope;
	var $compile;
	var VG_STATES;

	beforeEach(module('com.2fdevs.videogular'));
	beforeEach(module('com.2fdevs.videogular.plugins.poster'));

	beforeEach(inject(function ($injector) {
    $compile = $injector.get('$compile');
    $scope = $injector.get('$rootScope').$new();
    $sce = $injector.get('$sce');
    VG_STATES = $injector.get('VG_STATES');

    $scope.config = {
      preload: "none",
      controls: true,
      loop: true,
      sources: [
        {src: $sce.trustAsResourceUrl("assets/videos/videogular.mp4"), type: "video/mp4"},
        {src: $sce.trustAsResourceUrl("assets/videos/videogular.webm"), type: "video/webm"},
        {src: $sce.trustAsResourceUrl("assets/videos/videogular.ogg"), type: "video/ogg"}
      ],
      theme: {
        url: "styles/themes/default/videogular.css"
      },
      plugins: {
        poster: {
          url: "assets/images/videogular.png"
        }
      }
    };

		element = angular.element(
      '<videogular vg-theme="config.theme.url">' +
        '<vg-media vg-src="config.sources"></vg-media>' +
        '<vg-poster vg-url="config.plugins.poster.url"></vg-poster>' +
      '</videogular>'
    );

		$compile(element)($scope);
    $scope.$digest();
	}));

	describe("Element creation - ", function() {
		it("should have been created an image element", function() {
			var img = element.find("img");

      expect(img[0]).not.toBe(null);
      expect(img.attr("src")).toBe("assets/images/videogular.png");
		});
  });
});
<commit_msg>poster plugin add test for role attribute<commit_after>'use strict';
describe('Directive: Poster', function () {
  var element;
  var $sce;
	var $scope;
	var $compile;
	var VG_STATES;

	beforeEach(module('com.2fdevs.videogular'));
	beforeEach(module('com.2fdevs.videogular.plugins.poster'));

	beforeEach(inject(function ($injector) {
    $compile = $injector.get('$compile');
    $scope = $injector.get('$rootScope').$new();
    $sce = $injector.get('$sce');
    VG_STATES = $injector.get('VG_STATES');

    $scope.config = {
      preload: "none",
      controls: true,
      loop: true,
      sources: [
        {src: $sce.trustAsResourceUrl("assets/videos/videogular.mp4"), type: "video/mp4"},
        {src: $sce.trustAsResourceUrl("assets/videos/videogular.webm"), type: "video/webm"},
        {src: $sce.trustAsResourceUrl("assets/videos/videogular.ogg"), type: "video/ogg"}
      ],
      theme: {
        url: "styles/themes/default/videogular.css"
      },
      plugins: {
        poster: {
          url: "assets/images/videogular.png"
        }
      }
    };

		element = angular.element(
      '<videogular vg-theme="config.theme.url">' +
        '<vg-media vg-src="config.sources"></vg-media>' +
        '<vg-poster vg-url="config.plugins.poster.url"></vg-poster>' +
      '</videogular>'
    );

		$compile(element)($scope);
    $scope.$digest();
	}));

	describe("Element creation - ", function() {
		it("should have been created an image element", function() {
			var img = element.find("img");

      expect(img[0]).not.toBe(null);
      expect(img.attr("src")).toBe("assets/images/videogular.png");
		});
  });

	describe("Element attributes -", function() {
		it("should have a role attribute", function() {
			var img = element.find("img");

      expect(img.attr("role")).toBe("presentation");
		});
  });
});
<|endoftext|>


<commit_before><commit_msg>IE CEEE: Wrap frameElement access in ceee_bootstrap.js to prevent access denied error. BUG=none TEST=none<commit_after><|endoftext|>


<commit_before>require('shelljs/global')

const
  EXPECTED_FOLDER = 'test/expected',
  GENERATED_FOLDER = 'test/generated',
  trim = function(string) {
    return string.replace(/^\s+|\s+$/gm, '')
  },
  cli = require('../../lib')

describe('External config file', function() {
  it('generate the tags using custom parsers in the config file', function(done) {
    cli._cli([
      '--config',
      'test/fixtures/config-parsers'
    ])

    setImmediate(function() {
      expect(test('-e', `${GENERATED_FOLDER}/config-file/parsers.js`)).to.be(true)
      expect(trim(cat(`${GENERATED_FOLDER}/config-file/parsers.js`)))
        .to
        .be(trim(cat(`${EXPECTED_FOLDER}/config-file/parsers.js`)))
      done()
    })

  })

  it('generate the tags using custom pug parser', function(done) {
    cli._cli([
      '--config',
      'test/fixtures/config-parsers-pug'
    ])

    setImmediate(function() {
      expect(test('-e', `${GENERATED_FOLDER}/config-file/parsers-pug.js`)).to.be(true)
      expect(trim(cat(`${GENERATED_FOLDER}/config-file/parsers-pug.js`)))
        .to
        .be(trim(cat(`${EXPECTED_FOLDER}/config-file/parsers-pug.js`)))
      done()
    })

  })

  after(function() {
    //rm(`${GENERATED_FOLDER}/config-file/*`)
  })
})
<commit_msg>Uncomment the line accidentally commented out in previous commit<commit_after>require('shelljs/global')

const
  EXPECTED_FOLDER = 'test/expected',
  GENERATED_FOLDER = 'test/generated',
  trim = function(string) {
    return string.replace(/^\s+|\s+$/gm, '')
  },
  cli = require('../../lib')

describe('External config file', function() {
  it('generate the tags using custom parsers in the config file', function(done) {
    cli._cli([
      '--config',
      'test/fixtures/config-parsers'
    ])

    setImmediate(function() {
      expect(test('-e', `${GENERATED_FOLDER}/config-file/parsers.js`)).to.be(true)
      expect(trim(cat(`${GENERATED_FOLDER}/config-file/parsers.js`)))
        .to
        .be(trim(cat(`${EXPECTED_FOLDER}/config-file/parsers.js`)))
      done()
    })

  })

  it('generate the tags using custom pug parser', function(done) {
    cli._cli([
      '--config',
      'test/fixtures/config-parsers-pug'
    ])

    setImmediate(function() {
      expect(test('-e', `${GENERATED_FOLDER}/config-file/parsers-pug.js`)).to.be(true)
      expect(trim(cat(`${GENERATED_FOLDER}/config-file/parsers-pug.js`)))
        .to
        .be(trim(cat(`${EXPECTED_FOLDER}/config-file/parsers-pug.js`)))
      done()
    })

  })

  after(function() {
    rm(`${GENERATED_FOLDER}/config-file/*`)
  })
})
<|endoftext|>


<commit_before>{% comment %}

- Our reverse proxy must be configured to pass the original host header in X-Forwarded-Host.
- Django must be configured to use the X-Forwarded-Host header in preference to the Host header: USE_X_FORWARDED_HOST = True.
- MEDIA_URL must end in a slash if set to a non-empty value as per docs; assumed is that it also starts with one.
- Add 'django.template.context_processors.media' in the 'context_processors' option of TEMPLATES.

{% endcomment %}

(function () {

  window.Lizard = window.Lizard || {}; // don't override existing Lizard namespace.

  Lizard.startPlugins = function () {

    var appsButton = document.getElementById('lizard-apps-button');
    var title = appsButton.title;

    appsButton.innerHTML = `

      <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
        <path
         d="m 28.928575,79.407709 0,13.6363 q 0,2.8409 -1.5625,4.8296 -1.5625,1.9886 -3.79465,1.9886 l -17.8571393,0 q -2.23214,0 -3.79464,-1.9886 -1.56250001,-1.9887 -1.56250001,-4.8296 l 0,-13.6363 q 0,-2.841 1.56250001,-4.8296 1.5625,-1.9886 3.79464,-1.9886 l 17.8571393,0 q 2.23215,0 3.79465,1.9886 1.5625,1.9886 1.5625,4.8296 z m 0,-36.3637 0,13.6364 q 0,2.8409 -1.5625,4.8295 -1.5625,1.9887 -3.79465,1.9887 l -17.8571393,0 q -2.23214,0 -3.79464,-1.9887 -1.56250001,-1.9886 -1.56250001,-4.8295 l 0,-13.6364 q 0,-2.8409 1.56250001,-4.8295 1.5625,-1.9887 3.79464,-1.9887 l 17.8571393,0 q 2.23215,0 3.79465,1.9887 1.5625,1.9886 1.5625,4.8295 z m 35.71428,36.3637 0,13.6363 q 0,2.8409 -1.5625,4.8296 -1.5625,1.9886 -3.79464,1.9886 l -17.85714,0 q -2.23215,0 -3.79465,-1.9886 -1.5625,-1.9887 -1.5625,-4.8296 l 0,-13.6363 q 0,-2.841 1.5625,-4.8296 1.5625,-1.9886 3.79465,-1.9886 l 17.85714,0 q 2.23214,0 3.79464,1.9886 1.5625,1.9886 1.5625,4.8296 z m -35.71428,-72.7273004 0,13.6363004 q 0,2.841 -1.5625,4.8296 -1.5625,1.9886 -3.79465,1.9886 l -17.8571393,0 q -2.23214,0 -3.79464,-1.9886 -1.56250001,-1.9886 -1.56250001,-4.8296 l 0,-13.6363004 q 0,-2.8409 1.56250001,-4.8296 1.5625,-1.98860003 3.79464,-1.98860003 l 17.8571393,0 q 2.23215,0 3.79465,1.98860003 1.5625,1.9887 1.5625,4.8296 z m 35.71428,36.3636004 0,13.6364 q 0,2.8409 -1.5625,4.8295 -1.5625,1.9887 -3.79464,1.9887 l -17.85714,0 q -2.23215,0 -3.79465,-1.9887 -1.5625,-1.9886 -1.5625,-4.8295 l 0,-13.6364 q 0,-2.8409 1.5625,-4.8295 1.5625,-1.9887 3.79465,-1.9887 l 17.85714,0 q 2.23214,0 3.79464,1.9887 1.5625,1.9886 1.5625,4.8295 z m 35.714295,36.3637 0,13.6363 q 0,2.8409 -1.562505,4.8296 -1.5625,1.9886 -3.79465,1.9886 l -17.85714,0 q -2.23214,0 -3.79464,-1.9886 -1.5625,-1.9887 -1.5625,-4.8296 l 0,-13.6363 q 0,-2.841 1.5625,-4.8296 1.5625,-1.9886 3.79464,-1.9886 l 17.85714,0 q 2.23215,0 3.79465,1.9886 1.562505,1.9886 1.562505,4.8296 z M 64.642855,6.6804086 l 0,13.6363004 q 0,2.841 -1.5625,4.8296 -1.5625,1.9886 -3.79464,1.9886 l -17.85714,0 q -2.23215,0 -3.79465,-1.9886 -1.5625,-1.9886 -1.5625,-4.8296 l 0,-13.6363004 q 0,-2.8409 1.5625,-4.8296 1.5625,-1.98860003 3.79465,-1.98860003 l 17.85714,0 q 2.23214,0 3.79464,1.98860003 1.5625,1.9887 1.5625,4.8296 z m 35.714295,36.3636004 0,13.6364 q 0,2.8409 -1.562505,4.8295 -1.5625,1.9887 -3.79465,1.9887 l -17.85714,0 q -2.23214,0 -3.79464,-1.9887 -1.5625,-1.9886 -1.5625,-4.8295 l 0,-13.6364 q 0,-2.8409 1.5625,-4.8295 1.5625,-1.9887 3.79464,-1.9887 l 17.85714,0 q 2.23215,0 3.79465,1.9887 1.562505,1.9886 1.562505,4.8295 z m 0,-36.3636004 0,13.6363004 q 0,2.841 -1.562505,4.8296 -1.5625,1.9886 -3.79465,1.9886 l -17.85714,0 q -2.23214,0 -3.79464,-1.9886 -1.5625,-1.9886 -1.5625,-4.8296 l 0,-13.6363004 q 0,-2.8409 1.5625,-4.8296 1.5625,-1.98860003 3.79464,-1.98860003 l 17.85714,0 q 2.23215,0 3.79465,1.98860003 1.562505,1.9887 1.562505,4.8296 z"
         id="nine-blocks-lizard"/>
      </svg>
      ` + title + `
    `
    var appsContainer = document.getElementById('lizard-apps-container');
    appsContainer.innerHTML = `

      {% for app in view.screen.applications.all %}

            {{ app.name }}

      {% endfor %}

    `;

    appsButton.onclick = function() {
      var e = document.getElementById('lizard-apps-container');
      e.classList.toggle('hidden');
    };
  }
})();
<commit_msg>Fix slash to much.<commit_after>{% comment %}

- Our reverse proxy must be configured to pass the original host header in X-Forwarded-Host.
- Django must be configured to use the X-Forwarded-Host header in preference to the Host header: USE_X_FORWARDED_HOST = True.
- MEDIA_URL must end in a slash if set to a non-empty value as per docs; assumed is that it also starts with one.
- Add 'django.template.context_processors.media' in the 'context_processors' option of TEMPLATES.

{% endcomment %}

(function () {

  window.Lizard = window.Lizard || {}; // don't override existing Lizard namespace.

  Lizard.startPlugins = function () {

    var appsButton = document.getElementById('lizard-apps-button');
    var title = appsButton.title;

    appsButton.innerHTML = `

      <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
        <path
         d="m 28.928575,79.407709 0,13.6363 q 0,2.8409 -1.5625,4.8296 -1.5625,1.9886 -3.79465,1.9886 l -17.8571393,0 q -2.23214,0 -3.79464,-1.9886 -1.56250001,-1.9887 -1.56250001,-4.8296 l 0,-13.6363 q 0,-2.841 1.56250001,-4.8296 1.5625,-1.9886 3.79464,-1.9886 l 17.8571393,0 q 2.23215,0 3.79465,1.9886 1.5625,1.9886 1.5625,4.8296 z m 0,-36.3637 0,13.6364 q 0,2.8409 -1.5625,4.8295 -1.5625,1.9887 -3.79465,1.9887 l -17.8571393,0 q -2.23214,0 -3.79464,-1.9887 -1.56250001,-1.9886 -1.56250001,-4.8295 l 0,-13.6364 q 0,-2.8409 1.56250001,-4.8295 1.5625,-1.9887 3.79464,-1.9887 l 17.8571393,0 q 2.23215,0 3.79465,1.9887 1.5625,1.9886 1.5625,4.8295 z m 35.71428,36.3637 0,13.6363 q 0,2.8409 -1.5625,4.8296 -1.5625,1.9886 -3.79464,1.9886 l -17.85714,0 q -2.23215,0 -3.79465,-1.9886 -1.5625,-1.9887 -1.5625,-4.8296 l 0,-13.6363 q 0,-2.841 1.5625,-4.8296 1.5625,-1.9886 3.79465,-1.9886 l 17.85714,0 q 2.23214,0 3.79464,1.9886 1.5625,1.9886 1.5625,4.8296 z m -35.71428,-72.7273004 0,13.6363004 q 0,2.841 -1.5625,4.8296 -1.5625,1.9886 -3.79465,1.9886 l -17.8571393,0 q -2.23214,0 -3.79464,-1.9886 -1.56250001,-1.9886 -1.56250001,-4.8296 l 0,-13.6363004 q 0,-2.8409 1.56250001,-4.8296 1.5625,-1.98860003 3.79464,-1.98860003 l 17.8571393,0 q 2.23215,0 3.79465,1.98860003 1.5625,1.9887 1.5625,4.8296 z m 35.71428,36.3636004 0,13.6364 q 0,2.8409 -1.5625,4.8295 -1.5625,1.9887 -3.79464,1.9887 l -17.85714,0 q -2.23215,0 -3.79465,-1.9887 -1.5625,-1.9886 -1.5625,-4.8295 l 0,-13.6364 q 0,-2.8409 1.5625,-4.8295 1.5625,-1.9887 3.79465,-1.9887 l 17.85714,0 q 2.23214,0 3.79464,1.9887 1.5625,1.9886 1.5625,4.8295 z m 35.714295,36.3637 0,13.6363 q 0,2.8409 -1.562505,4.8296 -1.5625,1.9886 -3.79465,1.9886 l -17.85714,0 q -2.23214,0 -3.79464,-1.9886 -1.5625,-1.9887 -1.5625,-4.8296 l 0,-13.6363 q 0,-2.841 1.5625,-4.8296 1.5625,-1.9886 3.79464,-1.9886 l 17.85714,0 q 2.23215,0 3.79465,1.9886 1.562505,1.9886 1.562505,4.8296 z M 64.642855,6.6804086 l 0,13.6363004 q 0,2.841 -1.5625,4.8296 -1.5625,1.9886 -3.79464,1.9886 l -17.85714,0 q -2.23215,0 -3.79465,-1.9886 -1.5625,-1.9886 -1.5625,-4.8296 l 0,-13.6363004 q 0,-2.8409 1.5625,-4.8296 1.5625,-1.98860003 3.79465,-1.98860003 l 17.85714,0 q 2.23214,0 3.79464,1.98860003 1.5625,1.9887 1.5625,4.8296 z m 35.714295,36.3636004 0,13.6364 q 0,2.8409 -1.562505,4.8295 -1.5625,1.9887 -3.79465,1.9887 l -17.85714,0 q -2.23214,0 -3.79464,-1.9887 -1.5625,-1.9886 -1.5625,-4.8295 l 0,-13.6364 q 0,-2.8409 1.5625,-4.8295 1.5625,-1.9887 3.79464,-1.9887 l 17.85714,0 q 2.23215,0 3.79465,1.9887 1.562505,1.9886 1.562505,4.8295 z m 0,-36.3636004 0,13.6363004 q 0,2.841 -1.562505,4.8296 -1.5625,1.9886 -3.79465,1.9886 l -17.85714,0 q -2.23214,0 -3.79464,-1.9886 -1.5625,-1.9886 -1.5625,-4.8296 l 0,-13.6363004 q 0,-2.8409 1.5625,-4.8296 1.5625,-1.98860003 3.79464,-1.98860003 l 17.85714,0 q 2.23215,0 3.79465,1.98860003 1.562505,1.9887 1.562505,4.8296 z"
         id="nine-blocks-lizard"/>
      </svg>
      ` + title + `
    `
    var appsContainer = document.getElementById('lizard-apps-container');
    appsContainer.innerHTML = `

      {% for app in view.screen.applications.all %}

            {{ app.name }}

      {% endfor %}

    `;

    appsButton.onclick = function() {
      var e = document.getElementById('lizard-apps-container');
      e.classList.toggle('hidden');
    };
  }
})();
<|endoftext|>


<commit_before>import { LightningElement, api, track } from "lwc";
import stgHealthCheckLoadingIndicator from "@salesforce/label/c.stgHealthCheckLoadingIndicator";
//Account Model Settings Labels
import stgAccountModelSettingsTitle from "@salesforce/label/c.stgAccountModelSettingsTitle";
import stgAccModelTitle from "@salesforce/label/c.stgAccModelTitle";
import stgAdminAccountRecordType from "@salesforce/label/c.stgAdminAccountRecordType";
import stgAccountRecordTypeSupportsHHAddress from "@salesforce/label/c.stgAccountRecordTypeSupportsHHAddress";
import stgAccoutTypesWithoutContactsDelete from "@salesforce/label/c.stgAccoutTypesWithoutContactsDelete";
import stgLeadConversionAccountNaming from "@salesforce/label/c.stgLeadConversionAccountNaming";
//Contact Information Settings Labels
import stgContactInformationSettingsTitle from "@salesforce/label/c.stgContactInformationSettingsTitle";
import stgDefaultContactLanguageFluency from "@salesforce/label/c.stgDefaultContactLanguageFluency";
import stgDisablePreferredEmailEnforcement from "@salesforce/label/c.stgDisablePreferredEmailEnforcement";
import stgEnablePreferredPhoneSync from "@salesforce/label/c.stgEnablePreferredPhoneSync";
import stgPreferredPhoneDefault from "@salesforce/label/c.stgPreferredPhoneDefault";
//Address Settings Labels
import stgAccountTypesMultiAddressesEnabled from "@salesforce/label/c.stgAccountTypesMultiAddressesEnabled";
import stgAddressSettingsTitle from "@salesforce/label/c.stgAddressSettingsTitle";
import stgContactMultiAddressesEnabled from "@salesforce/label/c.stgContactMultiAddressesEnabled";
import stgSimpleAddressChangeUpdate from "@salesforce/label/c.stgSimpleAddressChangeUpdate";
//Affiliation Settings Labels
import stgTabAfflMappings from "@salesforce/label/c.stgTabAfflMappings";
import stgAffiliationsSettingsNav from "@salesforce/label/c.stgAffiliationsSettingsNav";
import afflTypeEnforced from "@salesforce/label/c.afflTypeEnforced";
//Course Enrollment Labels
import stgCoursesAndEnrollmentsNav from "@salesforce/label/c.stgCoursesAndEnrollmentsNav";
import stgProgramsSettingsNav from "@salesforce/label/c.stgProgramsSettingsNav";
//System Settings Labels
import stgSystemSettingsNav from "@salesforce/label/c.stgSystemSettingsNav";
//System Tools Labels
import stgSystemToolsNav from "@salesforce/label/c.stgSystemToolsNav";
//Error Settings Labels
import stgErrorSettingsNav from "@salesforce/label/c.stgErrorSettingsNav";
import stgStoreErrorsTitle from "@salesforce/label/c.stgStoreErrorsTitle";
import stgEnableDebugTitle from "@salesforce/label/c.stgEnableDebugTitle";
import stgDisableErrorHandlingTitle from "@salesforce/label/c.stgDisableErrorHandlingTitle";

export default class EdaSettingsNavigation extends LightningElement {
    labelReference = {
        peopleAndGroups: "People and Groups",
        setupHome: "Setup Home",
        spinnerLoadingAltText: stgHealthCheckLoadingIndicator,
        systemSettings: stgSystemSettingsNav,
        accountModel: {
            accountAutoDeletionModel: stgAccoutTypesWithoutContactsDelete,
            accountModelSettings: stgAccountModelSettingsTitle,
            adminAccountModel: stgAdminAccountRecordType,
            defaultAccountModel: stgAccModelTitle,
            hhAccountModel: stgAccountRecordTypeSupportsHHAddress,
            adminAccountNaming: "Administrative Account Name Format",
            hhAccountNaming: "Household Account Name Format",
            autoHHAccountNaming: "Automatically Rename Household Accounts",
            leadConversionAutoAccountNaming: stgLeadConversionAccountNaming,
        },
        addressSettings: {
            addressAccountRecordTypes: stgAccountTypesMultiAddressesEnabled,
            addressSettings: stgAddressSettingsTitle,
            contactMultipleAddresses: stgContactMultiAddressesEnabled,
            simpleAddressChangeIsUpdate: stgSimpleAddressChangeUpdate,
        },
        affiliationSettings: {
            affiliationMappings: stgTabAfflMappings,
            affiliationSettings: stgAffiliationsSettingsNav,
            enforceRecordTypeValidation: afflTypeEnforced,
        },
        contactInformation: {
            contactInformation: stgContactInformationSettingsTitle,
            defaultContactLanguageFluency: stgDefaultContactLanguageFluency,
            defaultPreferredPhone: stgPreferredPhoneDefault,
            enhancedPhoneFunctionality: stgEnablePreferredPhoneSync,
            requirePreferredEmail: stgDisablePreferredEmailEnforcement,
        },
        coursesAndEnrollmentsSettings: {
            coursesAndEnrollmentsSettings: stgCoursesAndEnrollmentsNav,
        },
        errorSettings: {
            enableDebug: stgEnableDebugTitle,
            enableErrorHandling: stgDisableErrorHandlingTitle,
            errorSettings: stgErrorSettingsNav,
            sendErrorNotifications: "Send Error Notifications",
            storeErrors: stgStoreErrorsTitle,
        },
        programSettings: {
            programSettings: stgProgramsSettingsNav,
            programAutoEnrollmentMappings: "Program Auto-Enrollment Mappings",
            programEnrollmentDeletions: "Program Enrollment Deletions",
        },
        relationshipSettings: {
            preventAutoCreatedDuplicateRelationships: "Prevent Auto-Created Duplicate Relations",
            reciprocalMethod: "Reciprocal Method",
            reciprocalRelationshipMappings: "Reciprocal Relationship mappings",
            relationshipAutocreateCampaignMappings: "Autocreate Campaign Mappings",
            relationshipAutocreateContactMappings: "Autocreate Contact Mappings",
            relationshipSettings: "Relationships",
        },
        systemTools: {
            courseConnectionBackfill: "Course Connection Backfill",
            courseDescriptionMigration: "Course Description Migration",
            ethnicityAndRaceBackfill: "Ethnicity and Race Backfill",
            preferredEmailCleanup: "Preferred Email and Phone Cleanup",
            systemToolsNav: stgSystemToolsNav,
            refreshAdministrativeAccountNames: "Refresh Administrative Account Names",
            refreshHouseholdAccountNames: "Refresh Household Account Names",
        },
    };

    @api activePage;

    @track viewModel = {
        navigationSections: [
            {
                label: this.labelReference.setupHome,
                page: "setupHome",
                id: "setupHome",
            },
            {
                label: this.labelReference.peopleAndGroups,
                id: "peopleAndGroups",
                navigationSubSections: [
                    {
                        label: this.labelReference.accountModel.accountModelSettings,
                        page: "accountModelSettings",
                        id: "accountModelSettings",
                        menuItems: [
                            { label: this.labelReference.accountModel.defaultAccountModel, id: "defaultAccountModel" },
                            {
                                label: this.labelReference.accountModel.adminAccountModel,
                                id: "adminAccountModel",
                            },
                            { label: this.labelReference.accountModel.hhAccountModel, id: "hhAccountModel" },
                            {
                                label: this.labelReference.accountModel.accountAutoDeletionModel,
                                id: "accountAutoDeletionModel",
                            },
                            { label: this.labelReference.accountModel.adminAccountNaming, id: "adminAccountNaming" },
                            { label: this.labelReference.accountModel.hhAccountNaming, id: "hhAccountNaming" },
                            { label: this.labelReference.accountModel.autoHHAccountNaming, id: "autoHHAccountNaming" },
                            {
                                label: this.labelReference.accountModel.leadConversionAutoAccountNaming,
                                id: "leadConversionAutoAccountNaming",
                            },
                        ],
                        isActive: true,
                    },
                    {
                        label: this.labelReference.contactInformation.contactInformation,
                        page: "contactInformationSettings",
                        id: "contactInformation",
                        menuItems: [
                            {
                                label: this.labelReference.contactInformation.defaultContactLanguageFluency,
                                id: "defaultContactLanguageFluency",
                            },
                            {
                                label: this.labelReference.contactInformation.requirePreferredEmail,
                                id: "requirePreferredEmail",
                            },
                            {
                                label: this.labelReference.contactInformation.enhancedPhoneFunctionality,
                                id: "enhancedPhoneFunctionality",
                            },
                            {
                                label: this.labelReference.contactInformation.defaultPreferredPhone,
                                id: "defaultPreferredPhone",
                            },
                        ],
                    },
                    {
                        label: this.labelReference.addressSettings.addressSettings,
                        page: "addressSettings",
                        id: "addresses",
                        menuItems: [
                            {
                                label: this.labelReference.addressSettings.contactMultipleAddresses,
                                id: "contactMultipleAddresses",
                            },
                            {
                                label: this.labelReference.addressSettings.simpleAddressChangeIsUpdate,
                                id: "addressAccountRecordTypes",
                            },
                            {
                                label: this.labelReference.addressSettings.addressAccountRecordTypes,
                                id: "simpleAddressChangeIsUpdate",
                            },
                        ],
                    },
                ],
            },
            {
                label: this.labelReference.affiliationSettings.affiliationSettings,
                page: "affiliationSettings",
                id: "affiliations",
                menuItems: [
                    {
                        label: this.labelReference.affiliationSettings.enforceRecordTypeValidation,
                        id: "enforceRecordTypeValidation",
                    },
                    {
                        label: this.labelReference.affiliationSettings.affiliationMappings,
                        id: "affiliationMappings",
                    },
                ],
            },
            {
                label: this.labelReference.relationshipSettings.relationshipSettings,
                page: "relationshipSettings",
                id: "relationshipSettings",
                menuItems: [
                    {
                        label: this.labelReference.relationshipSettings.reciprocalMethod,
                        id: "reciprocalMethod",
                    },
                    {
                        label: this.labelReference.relationshipSettings.preventAutoCreatedDuplicateRelationships,
                        id: "preventAutoCreatedDuplicateRelationships",
                    },
                    {
                        label: this.labelReference.relationshipSettings.preventAutoCreatedDuplicateRelationships,
                        id: "preventAutoCreatedDuplicateRelationships",
                    },
                    {
                        label: this.labelReference.relationshipSettings.reciprocalRelationshipMappings,
                        id: "reciprocalRelationshipMappings",
                    },
                    {
                        label: this.labelReference.relationshipSettings.relationshipAutocreateCampaignMappings,
                        id: "relationshipAutocreateCampaignMappings",
                    },
                    {
                        label: this.labelReference.relationshipSettings.relationshipAutocreateContactMappings,
                        id: "relationshipAutocreateContactMappings",
                    },
                ],
            },
            {
                label: this.labelReference.coursesAndEnrollmentsSettings.coursesAndEnrollmentsSettings,
                id: "coursesAndEnrollments",
                navigationSubSections: [
                    {
                        label: this.labelReference.programSettings.programSettings,
                        page: "programSettings",
                        id: "programSettings",
                        menuItems: [
                            {
                                label: this.labelReference.programSettings.programAutoEnrollmentMappings,
                                id: "programAutoEnrollmentMappings",
                            },
                            {
                                label: this.labelReference.programSettings.programEnrollmentDeletions,
                                id: "programEnrollmentDeletions",
                            },
                        ],
                    },
                ],
            },
            {
                label: this.labelReference.systemSettings,
                id: "systemSettings",
                navigationSubSections: [
                    {
                        label: this.labelReference.errorSettings.errorSettings,
                        page: "errorSettings",
                        id: "errorSettings",
                        menuItems: [
                            { label: this.labelReference.errorSettings.storeErrors, id: "storeErrors" },
                            {
                                label: this.labelReference.errorSettings.sendErrorNotifications,
                                id: "sendErrorNotifications",
                            },
                            {
                                label: this.labelReference.errorSettings.enableErrorHandling,
                                id: "enableErrorHandling",
                            },
                            { label: this.labelReference.errorSettings.enableDebug, id: "enableDebug" },
                        ],
                    },
                    {
                        label: this.labelReference.systemTools.systemToolsNav,
                        page: "systemTools",
                        id: "systemTools",
                        menuItems: [
                            {
                                label: this.labelReference.systemTools.refreshAdministrativeAccountNames,
                                id: "refreshAdministrativeAccountNames",
                            },
                            {
                                label: this.labelReference.systemTools.refreshHouseholdAccountNames,
                                id: "refreshHouseholdAccountNames",
                            },
                            {
                                label: this.labelReference.systemTools.preferredEmailCleanup,
                                id: "preferredEmailCleanup",
                            },
                            {
                                label: this.labelReference.systemTools.ethnicityAndRaceBackfill,
                                id: "ethnicityAndRaceBackfill",
                            },
                            {
                                label: this.labelReference.systemTools.courseConnectionBackfill,
                                id: "courseConnectionBackfill",
                            },
                            {
                                label: this.labelReference.systemTools.courseDescriptionMigration,
                                id: "courseDescriptionMigration",
                            },
                        ],
                    },
                ],
            },
        ],
    };
}
<commit_msg>added navs<commit_after>import { LightningElement, api, track } from "lwc";
import stgHealthCheckLoadingIndicator from "@salesforce/label/c.stgHealthCheckLoadingIndicator";
//Account Model Settings Labels
import stgAccountModelSettingsTitle from "@salesforce/label/c.stgAccountModelSettingsTitle";
import stgAccModelTitle from "@salesforce/label/c.stgAccModelTitle";
import stgAdminAccountRecordType from "@salesforce/label/c.stgAdminAccountRecordType";
import stgAccountRecordTypeSupportsHHAddress from "@salesforce/label/c.stgAccountRecordTypeSupportsHHAddress";
import stgAccoutTypesWithoutContactsDelete from "@salesforce/label/c.stgAccoutTypesWithoutContactsDelete";
import stgLeadConversionAccountNaming from "@salesforce/label/c.stgLeadConversionAccountNaming";
//Contact Information Settings Labels
import stgContactInformationSettingsTitle from "@salesforce/label/c.stgContactInformationSettingsTitle";
import stgDefaultContactLanguageFluency from "@salesforce/label/c.stgDefaultContactLanguageFluency";
import stgDisablePreferredEmailEnforcement from "@salesforce/label/c.stgDisablePreferredEmailEnforcement";
import stgEnablePreferredPhoneSync from "@salesforce/label/c.stgEnablePreferredPhoneSync";
import stgPreferredPhoneDefault from "@salesforce/label/c.stgPreferredPhoneDefault";
//Address Settings Labels
import stgAccountTypesMultiAddressesEnabled from "@salesforce/label/c.stgAccountTypesMultiAddressesEnabled";
import stgAddressSettingsTitle from "@salesforce/label/c.stgAddressSettingsTitle";
import stgContactMultiAddressesEnabled from "@salesforce/label/c.stgContactMultiAddressesEnabled";
import stgSimpleAddressChangeUpdate from "@salesforce/label/c.stgSimpleAddressChangeUpdate";
//Affiliation Settings Labels
import stgTabAfflMappings from "@salesforce/label/c.stgTabAfflMappings";
import stgAffiliationsSettingsNav from "@salesforce/label/c.stgAffiliationsSettingsNav";
import afflTypeEnforced from "@salesforce/label/c.afflTypeEnforced";
//Course Enrollment Labels
import stgCoursesAndEnrollmentsNav from "@salesforce/label/c.stgCoursesAndEnrollmentsNav";
import stgProgramsSettingsNav from "@salesforce/label/c.stgProgramsSettingsNav";
import stgAutoEnrollmentProgramTitle from "@salesforce/label/c.stgAutoEnrollmentProgramTitle";
import stgAfflProgEnrollSetRoleValue from "@salesforce/label/c.stgAfflProgEnrollSetRoleValue";
import stgAfflProgEnrollSetStatusValue from "@salesforce/label/c.stgAfflProgEnrollSetStatusValue";
import stgAfflCopyProgramEnrollmentEndDate from "@salesforce/label/c.stgAfflCopyProgramEnrollmentEndDate";
import stgAfflCopyProgramEnrollmentStartDate from "@salesforce/label/c.stgAfflCopyProgramEnrollmentStartDate";

//System Settings Labels
import stgSystemSettingsNav from "@salesforce/label/c.stgSystemSettingsNav";
//System Tools Labels
import stgSystemToolsNav from "@salesforce/label/c.stgSystemToolsNav";
//Error Settings Labels
import stgErrorSettingsNav from "@salesforce/label/c.stgErrorSettingsNav";
import stgStoreErrorsTitle from "@salesforce/label/c.stgStoreErrorsTitle";
import stgEnableDebugTitle from "@salesforce/label/c.stgEnableDebugTitle";
import stgDisableErrorHandlingTitle from "@salesforce/label/c.stgDisableErrorHandlingTitle";

export default class EdaSettingsNavigation extends LightningElement {
    labelReference = {
        peopleAndGroups: "People and Groups",
        setupHome: "Setup Home",
        spinnerLoadingAltText: stgHealthCheckLoadingIndicator,
        systemSettings: stgSystemSettingsNav,
        accountModel: {
            accountAutoDeletionModel: stgAccoutTypesWithoutContactsDelete,
            accountModelSettings: stgAccountModelSettingsTitle,
            adminAccountModel: stgAdminAccountRecordType,
            defaultAccountModel: stgAccModelTitle,
            hhAccountModel: stgAccountRecordTypeSupportsHHAddress,
            adminAccountNaming: "Administrative Account Name Format",
            hhAccountNaming: "Household Account Name Format",
            autoHHAccountNaming: "Automatically Rename Household Accounts",
            leadConversionAutoAccountNaming: stgLeadConversionAccountNaming,
        },
        addressSettings: {
            addressAccountRecordTypes: stgAccountTypesMultiAddressesEnabled,
            addressSettings: stgAddressSettingsTitle,
            contactMultipleAddresses: stgContactMultiAddressesEnabled,
            simpleAddressChangeIsUpdate: stgSimpleAddressChangeUpdate,
        },
        affiliationSettings: {
            affiliationMappings: stgTabAfflMappings,
            affiliationSettings: stgAffiliationsSettingsNav,
            enforceRecordTypeValidation: afflTypeEnforced,
        },
        contactInformation: {
            contactInformation: stgContactInformationSettingsTitle,
            defaultContactLanguageFluency: stgDefaultContactLanguageFluency,
            defaultPreferredPhone: stgPreferredPhoneDefault,
            enhancedPhoneFunctionality: stgEnablePreferredPhoneSync,
            requirePreferredEmail: stgDisablePreferredEmailEnforcement,
        },
        coursesAndEnrollmentsSettings: {
            coursesAndEnrollmentsSettings: stgCoursesAndEnrollmentsNav,
        },
        errorSettings: {
            enableDebug: stgEnableDebugTitle,
            enableErrorHandling: stgDisableErrorHandlingTitle,
            errorSettings: stgErrorSettingsNav,
            sendErrorNotifications: "Send Error Notifications",
            storeErrors: stgStoreErrorsTitle,
        },
        programSettings: {
            programSettings: stgProgramsSettingsNav,
            programAutoEnrollmentMappings: stgAutoEnrollmentProgramTitle,
            programEnrollmentDeletions: "Program Enrollment Deletions",
            roleForCreatedAffl: stgAfflProgEnrollSetRoleValue,
            statusForCreatedAffl: stgAfflProgEnrollSetStatusValue,
            afflEndDate: stgAfflCopyProgramEnrollmentEndDate,
            afflStartDate: stgAfflCopyProgramEnrollmentStartDate,
        },
        relationshipSettings: {
            preventAutoCreatedDuplicateRelationships: "Prevent Auto-Created Duplicate Relations",
            reciprocalMethod: "Reciprocal Method",
            reciprocalRelationshipMappings: "Reciprocal Relationship mappings",
            relationshipAutocreateCampaignMappings: "Autocreate Campaign Mappings",
            relationshipAutocreateContactMappings: "Autocreate Contact Mappings",
            relationshipSettings: "Relationships",
        },
        systemTools: {
            courseConnectionBackfill: "Course Connection Backfill",
            courseDescriptionMigration: "Course Description Migration",
            ethnicityAndRaceBackfill: "Ethnicity and Race Backfill",
            preferredEmailCleanup: "Preferred Email and Phone Cleanup",
            systemToolsNav: stgSystemToolsNav,
            refreshAdministrativeAccountNames: "Refresh Administrative Account Names",
            refreshHouseholdAccountNames: "Refresh Household Account Names",
        },
    };

    @api activePage;

    @track viewModel = {
        navigationSections: [
            {
                label: this.labelReference.setupHome,
                page: "setupHome",
                id: "setupHome",
            },
            {
                label: this.labelReference.peopleAndGroups,
                id: "peopleAndGroups",
                navigationSubSections: [
                    {
                        label: this.labelReference.accountModel.accountModelSettings,
                        page: "accountModelSettings",
                        id: "accountModelSettings",
                        menuItems: [
                            { label: this.labelReference.accountModel.defaultAccountModel, id: "defaultAccountModel" },
                            {
                                label: this.labelReference.accountModel.adminAccountModel,
                                id: "adminAccountModel",
                            },
                            { label: this.labelReference.accountModel.hhAccountModel, id: "hhAccountModel" },
                            {
                                label: this.labelReference.accountModel.accountAutoDeletionModel,
                                id: "accountAutoDeletionModel",
                            },
                            { label: this.labelReference.accountModel.adminAccountNaming, id: "adminAccountNaming" },
                            { label: this.labelReference.accountModel.hhAccountNaming, id: "hhAccountNaming" },
                            { label: this.labelReference.accountModel.autoHHAccountNaming, id: "autoHHAccountNaming" },
                            {
                                label: this.labelReference.accountModel.leadConversionAutoAccountNaming,
                                id: "leadConversionAutoAccountNaming",
                            },
                        ],
                        isActive: true,
                    },
                    {
                        label: this.labelReference.contactInformation.contactInformation,
                        page: "contactInformationSettings",
                        id: "contactInformation",
                        menuItems: [
                            {
                                label: this.labelReference.contactInformation.defaultContactLanguageFluency,
                                id: "defaultContactLanguageFluency",
                            },
                            {
                                label: this.labelReference.contactInformation.requirePreferredEmail,
                                id: "requirePreferredEmail",
                            },
                            {
                                label: this.labelReference.contactInformation.enhancedPhoneFunctionality,
                                id: "enhancedPhoneFunctionality",
                            },
                            {
                                label: this.labelReference.contactInformation.defaultPreferredPhone,
                                id: "defaultPreferredPhone",
                            },
                        ],
                    },
                    {
                        label: this.labelReference.addressSettings.addressSettings,
                        page: "addressSettings",
                        id: "addresses",
                        menuItems: [
                            {
                                label: this.labelReference.addressSettings.contactMultipleAddresses,
                                id: "contactMultipleAddresses",
                            },
                            {
                                label: this.labelReference.addressSettings.simpleAddressChangeIsUpdate,
                                id: "addressAccountRecordTypes",
                            },
                            {
                                label: this.labelReference.addressSettings.addressAccountRecordTypes,
                                id: "simpleAddressChangeIsUpdate",
                            },
                        ],
                    },
                ],
            },
            {
                label: this.labelReference.affiliationSettings.affiliationSettings,
                page: "affiliationSettings",
                id: "affiliations",
                menuItems: [
                    {
                        label: this.labelReference.affiliationSettings.enforceRecordTypeValidation,
                        id: "enforceRecordTypeValidation",
                    },
                    {
                        label: this.labelReference.affiliationSettings.affiliationMappings,
                        id: "affiliationMappings",
                    },
                ],
            },
            {
                label: this.labelReference.relationshipSettings.relationshipSettings,
                page: "relationshipSettings",
                id: "relationshipSettings",
                menuItems: [
                    {
                        label: this.labelReference.relationshipSettings.reciprocalMethod,
                        id: "reciprocalMethod",
                    },
                    {
                        label: this.labelReference.relationshipSettings.preventAutoCreatedDuplicateRelationships,
                        id: "preventAutoCreatedDuplicateRelationships",
                    },
                    {
                        label: this.labelReference.relationshipSettings.preventAutoCreatedDuplicateRelationships,
                        id: "preventAutoCreatedDuplicateRelationships",
                    },
                    {
                        label: this.labelReference.relationshipSettings.reciprocalRelationshipMappings,
                        id: "reciprocalRelationshipMappings",
                    },
                    {
                        label: this.labelReference.relationshipSettings.relationshipAutocreateCampaignMappings,
                        id: "relationshipAutocreateCampaignMappings",
                    },
                    {
                        label: this.labelReference.relationshipSettings.relationshipAutocreateContactMappings,
                        id: "relationshipAutocreateContactMappings",
                    },
                ],
            },
            {
                label: this.labelReference.coursesAndEnrollmentsSettings.coursesAndEnrollmentsSettings,
                id: "coursesAndEnrollments",
                navigationSubSections: [
                    {
                        label: this.labelReference.programSettings.programSettings,
                        page: "programSettings",
                        id: "programSettings",
                        menuItems: [
                            {
                                label: this.labelReference.programSettings.programEnrollmentDeletions,
                                id: "programEnrollmentDeletions",
                            },
                            {
                                label: this.labelReference.programSettings.roleForCreatedAffl,
                                id: "roleForCreatedAffiliations",
                            },
                            {
                                label: this.labelReference.programSettings.statusForCreatedAffl,
                                id: "statusForCreatedAffiliations",
                            },
                            {
                                label: this.labelReference.programSettings.afflEndDate,
                                id: "copyEndDate",
                            },
                            {
                                label: this.labelReference.programSettings.afflStartDate,
                                id: "copyStartDate",
                            },
                            {
                                label: this.labelReference.programSettings.programAutoEnrollmentMappings,
                                id: "programAutoEnrollmentMappings",
                            },
                        ],
                    },
                ],
            },
            {
                label: this.labelReference.systemSettings,
                id: "systemSettings",
                navigationSubSections: [
                    {
                        label: this.labelReference.errorSettings.errorSettings,
                        page: "errorSettings",
                        id: "errorSettings",
                        menuItems: [
                            { label: this.labelReference.errorSettings.storeErrors, id: "storeErrors" },
                            {
                                label: this.labelReference.errorSettings.sendErrorNotifications,
                                id: "sendErrorNotifications",
                            },
                            {
                                label: this.labelReference.errorSettings.enableErrorHandling,
                                id: "enableErrorHandling",
                            },
                            { label: this.labelReference.errorSettings.enableDebug, id: "enableDebug" },
                        ],
                    },
                    {
                        label: this.labelReference.systemTools.systemToolsNav,
                        page: "systemTools",
                        id: "systemTools",
                        menuItems: [
                            {
                                label: this.labelReference.systemTools.refreshAdministrativeAccountNames,
                                id: "refreshAdministrativeAccountNames",
                            },
                            {
                                label: this.labelReference.systemTools.refreshHouseholdAccountNames,
                                id: "refreshHouseholdAccountNames",
                            },
                            {
                                label: this.labelReference.systemTools.preferredEmailCleanup,
                                id: "preferredEmailCleanup",
                            },
                            {
                                label: this.labelReference.systemTools.ethnicityAndRaceBackfill,
                                id: "ethnicityAndRaceBackfill",
                            },
                            {
                                label: this.labelReference.systemTools.courseConnectionBackfill,
                                id: "courseConnectionBackfill",
                            },
                            {
                                label: this.labelReference.systemTools.courseDescriptionMigration,
                                id: "courseDescriptionMigration",
                            },
                        ],
                    },
                ],
            },
        ],
    };
}
<|endoftext|>


<commit_before>'use strict';

var helper    = require('../../helpers/angularity-test'),
    matchers  = require('../../helpers/jasmine-matchers'),
    buildTask = require('./build-task');

var fastIt = helper.jasmineFactory({
  before: 0,
  after : 500
});

var slowIt = helper.jasmineFactory({
  before: 500,
  after : 1000
});

var BUILD_FOLDER = 'app-build';
var TEST_FOLDER  = 'app-test';

describe('The Angularity watch task', function () {

  beforeEach(matchers.addMatchers);

  beforeEach(buildTask.customMatchers);

  beforeEach(customMatchers);

  beforeEach(helper.getTimeoutSwitch(60000));

  afterEach(helper.getTimeoutSwitch());

  afterEach(helper.cleanUp);

  describe('should display help when requested', function (done) {
    helper.runner.create()
      .addInvocation('watch --help')
      .addInvocation('watch -h')
//    .addInvocation('watch -?')  // TODO @bholloway process cannot be spawned on windows when it has -? flag
      .forEach(fastIt(expectations))
      .finally(done);

    function expectations(testCase) {
      expect([testCase.cwd, BUILD_FOLDER]).toBeEmptyDirectory();
      expect([testCase.cwd, TEST_FOLDER ]).toBeEmptyDirectory();
      expect(testCase.stderr).toBeWatchHelpWithError(false);
    }
  });

  describe('should operate minified (by default)', function(done) {
    helper.runner.create()
      .addSource('minimal-es5')
      .addInvocation('watch')
      .addInvocation('watch --unminified false')
      .addInvocation('watch -u false')
      .forEach(slowIt(expectations, progress))
      .finally(done);
  });

  describe('should operate unminified', function(done) {
    helper.runner.create()
      .addSource('minimal-es5-unminified')
      .addInvocation('watch --unminified')
      .addInvocation('watch -u')
      .addInvocation('watch --unminified true')
      .addInvocation('watch -u true')
      .forEach(slowIt(expectations, progress))
      .finally(done);
  });
});

function progress(testCase) {
  console.log(testCase.stdout, testCase.stderr);  // TODO @bholloway remove temporary logging
  if (/Finished 'watch'/.test(testCase.stdout)) {
    testCase.kill();
  }
}

function expectations(testCase) {
  expect(testCase.stdout).toBeTask('watch', 'sever');
  buildTask.expectations(testCase);
  // TODO @bholloway more test coverage on webstorm task
}

function customMatchers() {
  jasmine.addMatchers({
    toBeWatchHelpWithError: matchers.getHelpMatcher(/^\s*The "watch" task/)
  });
}<commit_msg>attempting to debug CI problem not seen locally<commit_after>'use strict';

var helper    = require('../../helpers/angularity-test'),
    matchers  = require('../../helpers/jasmine-matchers'),
    buildTask = require('./build-task');

var fastIt = helper.jasmineFactory({
  before: 0,
  after : 500
});

var slowIt = helper.jasmineFactory({
  before: 500,
  after : 1000
});

var BUILD_FOLDER = 'app-build';
var TEST_FOLDER  = 'app-test';

describe('The Angularity watch task', function () {

  beforeEach(matchers.addMatchers);

  beforeEach(buildTask.customMatchers);

  beforeEach(customMatchers);

  beforeEach(helper.getTimeoutSwitch(60000));

  afterEach(helper.getTimeoutSwitch());

  afterEach(helper.cleanUp);

  describe('should display help when requested', function (done) {
    helper.runner.create()
      .addInvocation('watch --help')
      .addInvocation('watch -h')
//    .addInvocation('watch -?')  // TODO @bholloway process cannot be spawned on windows when it has -? flag
      .forEach(fastIt(expectations))
      .finally(done);

    function expectations(testCase) {
      expect([testCase.cwd, BUILD_FOLDER]).toBeEmptyDirectory();
      expect([testCase.cwd, TEST_FOLDER ]).toBeEmptyDirectory();
      expect(testCase.stderr).toBeWatchHelpWithError(false);
    }
  });

  describe('should operate minified (by default)', function(done) {
    helper.runner.create()
      .addSource('minimal-es5')
      .addInvocation('watch')
      .addInvocation('watch --unminified false')
      .addInvocation('watch -u false')
      .forEach(slowIt(expectations, progress))
      .finally(done);
  });

  describe('should operate unminified', function(done) {
    helper.runner.create()
      .addSource('minimal-es5-unminified')
      .addInvocation('watch --unminified')
      .addInvocation('watch -u')
      .addInvocation('watch --unminified true')
      .addInvocation('watch -u true')
      .forEach(slowIt(expectations, progress))
      .finally(done);
  });
});

function progress(testCase) {
  console.log(testCase.stdout, testCase.stderr);  // TODO @bholloway remove temporary logging
  if (/Finished 'watch'/.test(testCase.stdout)) {
    console.log('!!!!!!KILL!!!!!!');              // TODO @bholloway remove temporary logging
    testCase.kill();
  }
}

function expectations(testCase) {
  expect(testCase.stdout).toBeTask('watch', 'sever');
  buildTask.expectations(testCase);
  // TODO @bholloway more test coverage on webstorm task
}

function customMatchers() {
  jasmine.addMatchers({
    toBeWatchHelpWithError: matchers.getHelpMatcher(/^\s*The "watch" task/)
  });
}<|endoftext|>


<commit_before>/*exported Tooltip*/
var Tooltip = (function( document ) {
  'use strict';

  var canvas;

  (function() {
    var WIDTH  = 360,
        HEIGHT = 100;

    var x, y;

    canvas = document.createElement( 'canvas' );
    canvas.width = WIDTH;
    canvas.height = HEIGHT;

    var ctx = canvas.getContext( '2d' );

    function hueToRgb( p, q, t ) {
      if ( t < 0 ) t += 1;
      if ( t > 1 ) t -= 1;
      if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;
      if ( t < 1 / 2 ) return q;
      if ( t < 2 / 3 ) return p + ( q - p ) * ( 2 / 3 - t ) * 6;
      return p;
    }

    /**
     * http://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion
     * hue: [0, 359)
     * saturation: [0, 100] %
     * lightness: [0, 100] %
     */
    function hslToRgb( h, s, l ) {
      // Transform to [0.0, 1.0].
      h /= 360;
      s *= 1e-2;
      l *= 1e-2;

      var r, g, b;

      if ( !s ) {
        r = g = b = l;
      } else {
        var q = l < 0.5 ? l + ( 1 + s ) : l + s - l * s;
        var p = 2 * l - q;
        r = hueToRgb( p, q, h + 1 / 3 );
        g = hueToRgb( p, q, h );
        b = hueToRgb( p, q, h - 1 / 3 );
      }

      return {
        r: Math.round( r * 255 ),
        g: Math.round( g * 255 ),
        b: Math.round( b * 255)
      };
    }

    console.time( 'imageData' );

    var imageData = ctx.getImageData( 0, 0, WIDTH, HEIGHT ),
        data = imageData.data;

    var index;
    var rgb;
    for ( y = 0; y < HEIGHT; y++ ) {
      for ( x = 0; x < WIDTH; x++ ) {
        index = 4 * ( y * WIDTH + x );

        rgb = hslToRgb( x, HEIGHT - y, 50 );

        data[ index     ] = rgb.r;
        data[ index + 1 ] = rgb.g;
        data[ index + 2 ] = rgb.b;
        data[ index + 3 ] = 255;
      }
    }

    ctx.putImageData( imageData, 0, 0 );

    console.timeEnd( 'imageData' );
  }) ();

  function Tooltip() {
    this.el = document.createElement( 'div' );
    this.el.classList.add( 'tooltip' );
    this.parentEl = null;

    this.width = 0;
    this.height = 0;
  }

  Tooltip.create = function( el ) {
    if ( !el ) {
      return;
    }

    var tooltip = new Tooltip();
    tooltip.setElement( el );
    tooltip.setContent( tooltip.direction );

    document.body.appendChild( tooltip.el );
    tooltip.updatePosition();

    return tooltip;
  };

  Tooltip.prototype.setElement = function( el ) {
    this.parentEl = el;
    this.direction = el.getAttribute( 'data-direction' );
  };

  Tooltip.prototype.setContent = function( content ) {
    this.el.textContent = content || '';
  };

  Tooltip.prototype.updatePosition = function() {
    var rect = this.el.getBoundingClientRect();
    var parentRect = this.parentEl.getBoundingClientRect();

    var x, y;

    if ( this.direction === 'left' || this.direction === 'right' ) {
      y = parentRect.top + 0.5 * ( parentRect.height - rect.height );
    }

    if ( this.direction === 'left' ) {
      x = parentRect.left - rect.width;
    }

    if ( this.direction === 'right' ) {
      x = parentRect.right;
    }

    if ( this.direction === 'top' || this.direction === 'bottom' ) {
      x = parentRect.left + 0.5 * ( parentRect.width - rect.width );
    }

    if ( this.direction === 'top' ) {
      y = parentRect.top - rect.height;
    }

    if ( this.direction === 'bottom' ) {
      y = parentRect.bottom;
    }

    this.el.style.left = Math.round( x || 0 ) + 'px';
    this.el.style.top = Math.round( y || 0 ) + 'px';
  };

  return Tooltip;
}) ( document );
<commit_msg>palette[tooltip]: Update Tooltip interface (chaining). Simplify positioning code.<commit_after>/*exported Tooltip*/
var Tooltip = (function( document ) {
  'use strict';

  var canvas;

  (function() {
    var WIDTH  = 360,
        HEIGHT = 100;

    var x, y;

    canvas = document.createElement( 'canvas' );
    canvas.width = WIDTH;
    canvas.height = HEIGHT;

    var ctx = canvas.getContext( '2d' );

    function hueToRgb( p, q, t ) {
      if ( t < 0 ) t += 1;
      if ( t > 1 ) t -= 1;
      if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;
      if ( t < 1 / 2 ) return q;
      if ( t < 2 / 3 ) return p + ( q - p ) * ( 2 / 3 - t ) * 6;
      return p;
    }

    /**
     * http://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion
     * hue: [0, 359)
     * saturation: [0, 100] %
     * lightness: [0, 100] %
     */
    function hslToRgb( h, s, l ) {
      // Transform to [0.0, 1.0].
      h /= 360;
      s *= 1e-2;
      l *= 1e-2;

      var r, g, b;

      if ( !s ) {
        r = g = b = l;
      } else {
        var q = l < 0.5 ? l + ( 1 + s ) : l + s - l * s;
        var p = 2 * l - q;
        r = hueToRgb( p, q, h + 1 / 3 );
        g = hueToRgb( p, q, h );
        b = hueToRgb( p, q, h - 1 / 3 );
      }

      return {
        r: Math.round( r * 255 ),
        g: Math.round( g * 255 ),
        b: Math.round( b * 255)
      };
    }

    console.time( 'imageData' );

    var imageData = ctx.getImageData( 0, 0, WIDTH, HEIGHT ),
        data = imageData.data;

    var index;
    var rgb;
    for ( y = 0; y < HEIGHT; y++ ) {
      for ( x = 0; x < WIDTH; x++ ) {
        index = 4 * ( y * WIDTH + x );

        rgb = hslToRgb( x, HEIGHT - y, 50 );

        data[ index     ] = rgb.r;
        data[ index + 1 ] = rgb.g;
        data[ index + 2 ] = rgb.b;
        data[ index + 3 ] = 255;
      }
    }

    ctx.putImageData( imageData, 0, 0 );

    console.timeEnd( 'imageData' );
  }) ();

  function Tooltip() {
    this.el = document.createElement( 'div' );
    this.el.classList.add( 'tooltip' );
    this.parentEl = null;
    this.direction = null;
  }

  Tooltip.create = function( el ) {
    if ( !el ) {
      return;
    }

    var tooltip = new Tooltip();
    tooltip.attach( el );
    tooltip.content( tooltip.direction );

    document.body.appendChild( tooltip.el );
    tooltip.update();

    return tooltip;
  };

  Tooltip.prototype.attach = function( el ) {
    this.parentEl = el;
    this.direction = el.getAttribute( 'data-direction' );
    return this;
  };

  Tooltip.prototype.content = function( content ) {
    if ( typeof content !== 'undefined' ) {
      this.el.textContent = content;
    }

    return this.el.textContent;
  };

  Tooltip.prototype.update = function() {
    var rect = this.el.getBoundingClientRect();
    var parentRect = this.parentEl.getBoundingClientRect();

    var x, y;

    var top    = this.direction === 'top';
    var right  = this.direction === 'right';
    var bottom = this.direction === 'bottom';
    var left   = this.direction === 'left';

    if ( left || right ) {
      y = parentRect.top + 0.5 * ( parentRect.height - rect.height );

      if ( left  ) {
        x = parentRect.left - rect.width;
      }

      if ( right ) {
        x = parentRect.right;
      }
    }

    if ( top || bottom ) {
      x = parentRect.left + 0.5 * ( parentRect.width - rect.width );

      if ( top ) {
        y = parentRect.top - rect.height;
      }

      if ( bottom ) {
        y = parentRect.bottom;
      }
    }

    this.el.style.left = Math.round( x || 0 ) + 'px';
    this.el.style.top  = Math.round( y || 0 ) + 'px';
    return this;
  };

  return Tooltip;
}) ( document );
<|endoftext|>


<commit_before>"use strict";
var GITHUB_DOMAIN = "https://github.com";
function parse(event) {
    var repo = event.repo.name;
    switch (event.type) {
        case 'CreateEvent':
            switch (event.payload.ref_type) {
                case 'repository':
                    return {
                        text: "created repo {{repository}}",
                        data: {
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo
                    };
                case 'tag':
                    return {
                        text: "created tag {{ref_type}} at {{repository}}",
                        data: {
                            ref_type: event.payload.ref_type,
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo + "/releases/tag/" + event.payload.ref
                    };
                case 'branch':
                    return {
                        text: "created branch {{ref_type}} at {{repository}}",
                        data: {
                            ref_type: event.payload.ref_type,
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo + "/tree/" + event.payload.ref
                    };
            }
            break;
        case 'MemberEvent':
            switch (event.payload.action) {
                case 'added':
                    return {
                        text: "added {{member}} to {{repository}}",
                        data: {
                            member: event.payload.member,
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + event.payload.member.login
                    };
            }
            break;
        case 'PushEvent':
            var branch = event.payload.ref.substr(event.payload.ref.lastIndexOf('/') + 1);
            return {
                text: "pushed to {{branch}} at {{repository}}",
                data: {
                    branch: branch,
                    repository: repo
                },
                html_url: GITHUB_DOMAIN + "/" + repo + "/compare/" + event.payload.before + "..." + event.payload.head
            };
            break;
        case 'ForkApplyEvent':
            return {
                text: "merged to {{repository}}",
                data: {
                    repository: repo
                },
                html_url: GITHUB_DOMAIN + "/" + repo.name + "/compare/" + event.payload.before + "..." + event.payload.head
            };
            break;
        case 'ForkEvent':
            return {
                text: "forked {{repository}}",
                data: {
                    repository: repo
                },
                html_url: event.payload.forkee.html_url
            };
            break;
        case 'WatchEvent':
            switch (event.payload.action) {
                case 'started':
                    return {
                        text: "started watching {{repository}}",
                        data: {
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo
                    };
                    break;
                case 'stopped':
                    return {
                        text: "stopped watching {{repository}}",
                        data: {
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo
                    };
            }
            break;
        case 'FollowEvent':
            return {
                text: "followed {{login}}",
                data: {
                    login: event.payload.target.login,
                    name: event.payload.target.name
                },
                html_url: GITHUB_DOMAIN + "/" + event.payload.target.login
            };
            break;
        case 'IssuesEvent':
        case 'PullRequestEvent':
            var payloadObject = (event.payload.pull_request || event.payload.issue);
            switch (event.payload.action) {
                case 'opened':
                case 'reopened':
                    return {
                        text: "opened issue on {{repository}}#{{number}}",
                        data: {
                            repository: repo,
                            number: payloadObject.number
                        },
                        html_url: payloadObject.html_url
                    };
                case 'closed':
                    return {
                        text: "closed issue on {{repository}}#{{number}}",
                        data: {
                            repository: repo,
                            number: payloadObject.number
                        },
                        html_url: payloadObject.html_url
                    };
            }
            break;
        case 'GistEvent':
            switch (event.payload.action) {
                case 'create':
                    return {
                        text: "created {{name}}",
                        data: {
                            name: event.payload.name
                        },
                        html_url: event.payload.gist.html_url
                    };
                case 'update':
                    return {
                        text: "updated {{name}}",
                        data: {
                            name: event.payload.name
                        },
                        html_url: event.payload.gist.html_url
                    };
                case 'fork':
                    return {
                        text: "forked {{name}}",
                        data: {
                            name: event.payload.name
                        },
                        html_url: event.payload.gist.html_url
                    };
            }
            break;
        case 'WikiEvent':
        case 'GollumEvent':
            if (event.payload.pages.some(function (page) {
                return page.action === "created";
            })) {// created
                return {
                    text: "created a wiki page on {{repository}}",
                    data: {
                        repository: repo
                    },
                    html_url: event.payload.pages[0].html_url

                };
            } else { // edited
                return {
                    text: "edited a wiki page on {{repository}}",
                    data: {
                        repository: repo
                    },
                    // https://github.com/Constellation/escodegen/wiki/_compare/8071c6feb719b3c9e1742620aab9c1bbfda80e70...a567b1a221885a9ae5c576561e18ce68909624b6
                    html_url: GITHUB_DOMAIN + "/" + repo
                        + "/wiki/_compare/" + event.payload.pages[0].sha + "..." + event.payload.pages[event.payload.pages.length].sha
                };
            }
            break;
        case 'CommitCommentEvent':
            return {
                text: "commented on {{repository}}",
                data: {
                    repository: repo
                },
                html_url: event.payload.comment.html_url
            };
        case 'PullRequestReviewCommentEvent':
            return {
                text: "commented on {{repository}}",
                data: {
                    repository: repo
                },
                html_url: event.payload.comment.html_url
            };
        case 'IssueCommentEvent':
            return {
                text: "commented on {{repository}}#{{number}}",
                data: {
                    repository: repo,
                    number: (event.payload.pull_request || event.payload.issue).number
                },
                html_url: event.payload.comment.html_url
            };

        case 'DeleteEvent':
            switch (event.payload.ref_type) {
                case 'branch':
                    return {
                        text: "deleted branch {{ref}} at {{repository}}",
                        data: {
                            ref: event.payload.ref,
                            ref_type: event.payload.ref_type,
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo
                    };
            }
            break;
        case 'PublicEvent':
            return {
                text: "open sourced {{repository}}",
                data: {
                    repository: repo
                },
                html_url: GITHUB_DOMAIN + "/" + repo
            };
        case 'DownloadEvent':
            return {
                text: "created download {{name}}",
                data: {
                    name: event.payload.download.name
                },
                html_url: event.payload.download.html_url
            };
    }
    console.warn('Event:' + event.type, event);
    // Dummy Object
    return {
        text: "Dummy!! " + event.type,
        data: {}
    }
}

function compile(event) {
    var object = parse(event);
    var userName = event.actor.login;
    var keys = Object.keys(object.data);
    var result = object.text;
    keys.forEach(function (key) {
        result = result.replace("{{" + key + "}}", object.data[key]);
    });
    return userName + " " + result;
}
module.exports.parse = parse;
module.exports.compile = compile;
<commit_msg>fix(parse): fix error of range at GollumEvent<commit_after>"use strict";
var GITHUB_DOMAIN = "https://github.com";
function parse(event) {
    var repo = event.repo.name;
    switch (event.type) {
        case 'CreateEvent':
            switch (event.payload.ref_type) {
                case 'repository':
                    return {
                        text: "created repo {{repository}}",
                        data: {
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo
                    };
                case 'tag':
                    return {
                        text: "created tag {{ref_type}} at {{repository}}",
                        data: {
                            ref_type: event.payload.ref_type,
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo + "/releases/tag/" + event.payload.ref
                    };
                case 'branch':
                    return {
                        text: "created branch {{ref_type}} at {{repository}}",
                        data: {
                            ref_type: event.payload.ref_type,
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo + "/tree/" + event.payload.ref
                    };
            }
            break;
        case 'MemberEvent':
            switch (event.payload.action) {
                case 'added':
                    return {
                        text: "added {{member}} to {{repository}}",
                        data: {
                            member: event.payload.member,
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + event.payload.member.login
                    };
            }
            break;
        case 'PushEvent':
            var branch = event.payload.ref.substr(event.payload.ref.lastIndexOf('/') + 1);
            return {
                text: "pushed to {{branch}} at {{repository}}",
                data: {
                    branch: branch,
                    repository: repo
                },
                html_url: GITHUB_DOMAIN + "/" + repo + "/compare/" + event.payload.before + "..." + event.payload.head
            };
            break;
        case 'ForkApplyEvent':
            return {
                text: "merged to {{repository}}",
                data: {
                    repository: repo
                },
                html_url: GITHUB_DOMAIN + "/" + repo.name + "/compare/" + event.payload.before + "..." + event.payload.head
            };
            break;
        case 'ForkEvent':
            return {
                text: "forked {{repository}}",
                data: {
                    repository: repo
                },
                html_url: event.payload.forkee.html_url
            };
            break;
        case 'WatchEvent':
            switch (event.payload.action) {
                case 'started':
                    return {
                        text: "started watching {{repository}}",
                        data: {
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo
                    };
                    break;
                case 'stopped':
                    return {
                        text: "stopped watching {{repository}}",
                        data: {
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo
                    };
            }
            break;
        case 'FollowEvent':
            return {
                text: "followed {{login}}",
                data: {
                    login: event.payload.target.login,
                    name: event.payload.target.name
                },
                html_url: GITHUB_DOMAIN + "/" + event.payload.target.login
            };
            break;
        case 'IssuesEvent':
        case 'PullRequestEvent':
            var payloadObject = (event.payload.pull_request || event.payload.issue);
            switch (event.payload.action) {
                case 'opened':
                case 'reopened':
                    return {
                        text: "opened issue on {{repository}}#{{number}}",
                        data: {
                            repository: repo,
                            number: payloadObject.number
                        },
                        html_url: payloadObject.html_url
                    };
                case 'closed':
                    return {
                        text: "closed issue on {{repository}}#{{number}}",
                        data: {
                            repository: repo,
                            number: payloadObject.number
                        },
                        html_url: payloadObject.html_url
                    };
            }
            break;
        case 'GistEvent':
            switch (event.payload.action) {
                case 'create':
                    return {
                        text: "created {{name}}",
                        data: {
                            name: event.payload.name
                        },
                        html_url: event.payload.gist.html_url
                    };
                case 'update':
                    return {
                        text: "updated {{name}}",
                        data: {
                            name: event.payload.name
                        },
                        html_url: event.payload.gist.html_url
                    };
                case 'fork':
                    return {
                        text: "forked {{name}}",
                        data: {
                            name: event.payload.name
                        },
                        html_url: event.payload.gist.html_url
                    };
            }
            break;
        case 'WikiEvent':
        case 'GollumEvent':
            if (event.payload.pages.some(function (page) {
                return page.action === "created";
            })) {// created
                return {
                    text: "created a wiki page on {{repository}}",
                    data: {
                        repository: repo
                    },
                    html_url: event.payload.pages[0].html_url

                };
            } else { // edited
                return {
                    text: "edited a wiki page on {{repository}}",
                    data: {
                        repository: repo
                    },
                    // https://github.com/Constellation/escodegen/wiki/_compare/8071c6feb719b3c9e1742620aab9c1bbfda80e70...a567b1a221885a9ae5c576561e18ce68909624b6
                    html_url: GITHUB_DOMAIN + "/" + repo
                        + "/wiki/_compare/" + event.payload.pages[0].sha + "..." + event.payload.pages[event.payload.pages.length-1].sha
                };
            }
            break;
        case 'CommitCommentEvent':
            return {
                text: "commented on {{repository}}",
                data: {
                    repository: repo
                },
                html_url: event.payload.comment.html_url
            };
        case 'PullRequestReviewCommentEvent':
            return {
                text: "commented on {{repository}}",
                data: {
                    repository: repo
                },
                html_url: event.payload.comment.html_url
            };
        case 'IssueCommentEvent':
            return {
                text: "commented on {{repository}}#{{number}}",
                data: {
                    repository: repo,
                    number: (event.payload.pull_request || event.payload.issue).number
                },
                html_url: event.payload.comment.html_url
            };

        case 'DeleteEvent':
            switch (event.payload.ref_type) {
                case 'branch':
                    return {
                        text: "deleted branch {{ref}} at {{repository}}",
                        data: {
                            ref: event.payload.ref,
                            ref_type: event.payload.ref_type,
                            repository: repo
                        },
                        html_url: GITHUB_DOMAIN + "/" + repo
                    };
            }
            break;
        case 'PublicEvent':
            return {
                text: "open sourced {{repository}}",
                data: {
                    repository: repo
                },
                html_url: GITHUB_DOMAIN + "/" + repo
            };
        case 'DownloadEvent':
            return {
                text: "created download {{name}}",
                data: {
                    name: event.payload.download.name
                },
                html_url: event.payload.download.html_url
            };
    }
    console.warn('Event:' + event.type, event);
    // Dummy Object
    return {
        text: "Dummy!! " + event.type,
        data: {}
    }
}

function compile(event) {
    var object = parse(event);
    var userName = event.actor.login;
    var keys = Object.keys(object.data);
    var result = object.text;
    keys.forEach(function (key) {
        result = result.replace("{{" + key + "}}", object.data[key]);
    });
    return userName + " " + result;
}
module.exports.parse = parse;
module.exports.compile = compile;
<|endoftext|>


<commit_before>'use strict';

require.config({
  baseUrl: '../../',

  paths: {
    //jquery
    'jquery': 'lib/jquery/dist/jquery.min',
    'jquery-ui': 'lib/jquery-ui/jquery-ui.min',
    'jquery-migrate': 'lib/jquery-migrate/jquery-migrate.min',

    //twitterBootstrap
    'twitterBootstrap': 'lib/bootstrap/dist/js/bootstrap.min',

    //angular
    'angular': 'lib/angular/angular.min',
    'ui.router': 'lib/angular-ui-router/release/angular-ui-router',
    'ngRoute': 'lib/angular-route/angular-route.min',

    //myApp
    'beeer' : 'partials/beeer/app'
  },

  shim: {
    'jquery-migrate': ['jquery'],
    'jquery-ui': ['jquery-migrate'],
    'twitterBootstrap': ['jquery-ui'],
    'angular': ['twitterBootstrap'],
    'ngRoute': ['angular'],
    'ui.router': ['ngRoute'],
    'beeer' : ['ui.router']
  }
});

require(	[
    'beeer'
  ],
  function (beeer) {
    $(document).ready(function () {
      layoutScroll();
    });
  }//$(document).ready
);//require

function layoutScroll() {
  var arrSecTOP = [];
  var idx = 0;
  $('article > section').each(function () {
    arrSecTOP.push($(this).offset().top)
  });
  $('.snb li').on('click',function(){
    var $this = $(this);
    $this.addClass('on').siblings().removeClass('on')
      .find('ul').slideUp("slow").children().removeClass('on');
    if($this.is('.home')){
      $('article').stop().animate({scrollTop:idx});
    }
    if($this.children().is('ul')){$this.find('ul').slideDown("slow")}
    if($this.parent().is('.snb-sub')){
      idx = $this.index();
      $('article').stop().animate({scrollTop:arrSecTOP[idx+1]-20});
    }
    if($this.is('.end-list')){
      $('article').stop().animate({scrollTop:arrSecTOP[arrSecTOP.length-1]});
    }
  });
}

angular.module('todoapp', [])
<commit_msg>rewrite beeer<commit_after>'use strict';

require.config({
  baseUrl: '../../',

  paths: {
    //jquery
    'jquery': 'lib/jquery/dist/jquery.min',
    'jquery-ui': 'lib/jquery-ui/jquery-ui.min',
    'jquery-migrate': 'lib/jquery-migrate/jquery-migrate.min',

    //twitterBootstrap
    'twitterBootstrap': 'lib/bootstrap/dist/js/bootstrap.min',

    //angular
    'angular': 'lib/angular/angular.min',
    'ui.router': 'lib/angular-ui-router/release/angular-ui-router',
    'ngRoute': 'lib/angular-route/angular-route.min',

    //myApp
    'beeer' : 'partials/beeer/app'
  },

  shim: {
    'jquery-migrate': ['jquery'],
    'jquery-ui': ['jquery-migrate'],
    'twitterBootstrap': ['jquery-ui'],
    'angular': ['twitterBootstrap'],
    'ngRoute': ['angular'],
    'ui.router': ['ngRoute'],
    'beeer' : ['ui.router']
  }
});

require(	[
    'beeer'
  ],
  function (beeer) {
    $(document).ready(function () {
      layoutScroll();
    });
  }//$(document).ready
);//require

function layoutScroll() {
  var arrSecTOP = [];
  var idx = 0;
  $('article > section').each(function () {
    arrSecTOP.push($(this).offset().top)
  });
  $('.snb li').on('click',function(){
    var $this = $(this);
    $this.addClass('on').siblings().removeClass('on')
      .find('ul').slideUp("slow").children().removeClass('on');
    if($this.is('.home')){
      $('article').stop().animate({scrollTop:idx});
    }
    if($this.children().is('ul')){$this.find('ul').slideDown("slow")}
    if($this.parent().is('.snb-sub')){
      idx = $this.index();
      $('article').stop().animate({scrollTop:arrSecTOP[idx+1]-20});
    }
    if($this.is('.end-list')){
      $('article').stop().animate({scrollTop:arrSecTOP[arrSecTOP.length-1]});
    }
  });
}

angular.module('todoapp', []);
<|endoftext|>